home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.2 / Video Toaster v4.2.iso / arexx / toasterpaint / sepiavignette.rexx < prev    next >
OS/2 REXX Batch file  |  1995-12-27  |  4KB  |  131 lines

  1. /* SepiaVignette.rexx -- Make a Pic Or Clip sepia. */
  2. /* By Bob Caron © 1995 NewTek Inc.                 */
  3. /* Originaly by Arnie Cachelin                     */
  4.  
  5. parse arg InClipName","OutClipName","StartField","EndField
  6.  
  7. Address "DigiPaint"
  8. options results
  9.  
  10. screen=0
  11. if inclipname="" & outclipname="" then screen=1
  12. if screen=1 then do
  13.    startfield=1
  14.    endfield=1
  15.    outclipname="Test"
  16.    end
  17.  
  18. IFFBaseName=OutClipName
  19.  
  20. if ~show('l','rexxsupport.library') then do
  21.   if ~addlib('rexxsupport.library',0,-30,34) then do
  22.     exit
  23.   end
  24. end
  25.  
  26. /* Reset Paint */
  27. 'Pmcl'
  28. 'Pot0' 0
  29. 'Pot1' 0
  30. 'Poth' $8000
  31. 'Potv' $8000
  32. 'Spoh' $8000
  33. 'Spov'
  34. /* End Of Reset*/
  35.  
  36. PageWide=752
  37. PageHigh=480
  38. dots=0
  39. XWin = 100
  40. YWin = 40
  41. Clear = d2c(12)
  42. nv = ''
  43. cr = '0a'x
  44. call getfontsize
  45.  
  46. wid = width*48
  47. hei = theight+height*10
  48.  
  49. if screen=0 then do
  50.    if ~open('Window','RAW:'XWin'/'YWin'/'wid'/'hei'/SepiaVignette Script V2.0 - CTRL-C to Abort/NOSIZE/SCREEN 'ps,'W') then do
  51.        exit
  52.    end
  53. end
  54.  
  55. do Frame = StartField to (StartField+(EndField-StartField)/2)
  56.   if screen=0 then  call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame)
  57.   if screen=0 then 'Gnfd'          /* Get the next field to process          */
  58.   call filter()                    /* Do The filter Thing...                 */
  59.   if screen=0 then 'Apfc'          /* Apeend the field to clip               */
  60.   if screen=0 then 'Gnfd'          /* Get the next field to process          */
  61.   if screen=0 then call filter()   /* If this is a flyer clip do other field */
  62.   if screen=0 then 'Apfc'          /* Apeend the field to clip               */
  63.   if screen=1 then 'Shco'          /* Render To Buffer (if this is screen processing)*/
  64.   end
  65. if screen=0 then 'Iclp'            /* Add an flyer icon to this clip */
  66. exit
  67.  
  68. filter:  /* Do a filter */
  69.  
  70. if screen=0 then  call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame) /* Update window and dots. */
  71. 'Pmcl'          /* Set to normal paint mode */
  72. 'Cbx7'          /* Set to Sepia (?) */
  73. 'Hvof'          /* Set to radial gradient off */
  74. if screen=0 then  call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame) /* Update window and dots. */
  75. 'Hvar'          /* Toggle radial gradient blend */
  76. 'Potv' $8000    /* Set hotspot center */
  77. 'Poth' $8000    /* Set hotspot  center */
  78. if screen=0 then  call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame) /* Update window and dots. */
  79. 'Minc'          /* Set Center transparency to 0% */
  80. 'Maxe'          /* Set Edge transparency to 100% */
  81. 'Whsc'          /* Fill Whole Screen */
  82. if screen=0 then  call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame) /* Update window and dots. */
  83. 'Whsc'          /* Fill Whole Screen */
  84.  
  85. return
  86.  
  87.  
  88. OpenWindow:
  89. parse arg InclipName,OutClipName,currentframe,EndFrame,Frame
  90.   pdots="...."
  91.   dots=dots+1
  92.   if dots>4 then dots=1
  93.   call writech('Window',Clear||nv||cr)
  94.   call writech('Window','Current Source Clip ['InClipName']'cr)
  95.   call writech('Window','  Current Dest Clip ['OutClipName']'cr)
  96.   call writech('Window',''cr)
  97.   call writech('Window','Current Frame: 'Frame/2''cr)
  98.   call writech('Window','    End Frame:'EndFrame/2''cr)
  99.   call writech('Window',''cr)
  100.   call writech('Window','Processing'right(pdots,dots)||cr)
  101.  
  102. return
  103.  
  104.  
  105. getfontsize:
  106.  
  107. if open('font','env:sys/font.prefs','R') then do
  108.    font = readch('font',word(statef('env:sys/font.prefs'),2))
  109.    call close('font')
  110.    font = substr(font,index(font,'FONT')+4)
  111.    font = substr(font,index(font,'FONT')+4)
  112.    height = c2d(substr(font,29,2))
  113.    tfont = substr(font,index(font,'FONT')+4)
  114.    theight = c2d(substr(tfont,29,2))
  115.    font = substr(font,33)
  116.    font = left(font,index(font,d2c(0))-1-5)
  117.    if open('font','FONTS:'font'/'height,'R') then do
  118.       width = c2d(right(readch('font',116),2))
  119.       call close('font')
  120.   end
  121.   else if height=9 then width = 10
  122.                    else width = 8
  123. end
  124.   else do
  125.   theight = 8
  126.   height = 8
  127.   width = 8
  128. end
  129.  
  130. return
  131.